package  {
	import flash.geom.Rectangle;
	import fs.tileMap.Character;
	import fs.tileMap.manager.IHitManager;
	import fs.tileMap.TileMap;
	import fs.tileMap.view.tile.AbstractTile;
	
	/**
	 * ...
	 * @author flyingSnow
	 */
	public class MyHitManager implements IHitManager {
		public function MyHitManager() {
			
		}
		
		/* INTERFACE fs.tileMap.manager.IHitManager */
		
		public function onHit(char:Character, tile:AbstractTile,direction:int):Boolean {
			if (tile.code == 0xff0000) {
				
				if (direction&1){
					char.v.y = char.a.y = 0;
					//(tile as MyMapTile).text = "上";
				}else if (direction&4){
					char.v.y = char.a.y=0;
					//(tile as MyMapTile).text = "下";
				}else if (direction&8){
					char.v.x = char.a.x = 0;
					//(tile as MyMapTile).text = "左";
				}else if (direction&2){
					char.v.x = char.a.x = 0;
					//(tile as MyMapTile).text = "右";
				}
				
				return true;
			}
		//(tile as MyMapTile).text = "空";
			return false;
		}
		
	}

}